#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable : 6031)

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include "queue.h"

typedef struct binarytree
{
	int data;
	struct binarytree* left;
	struct binarytree* right;
}bt;

bt* buybt(int x);

bt* creattree();

void btdestroy(bt* node);

void printprev(bt* node);

void printmid(bt* node);

void printtail(bt* node);

void printfloor(bt* node);

int nodesize(bt* node);

int leafsize(bt* node);

int treehigh(bt* node);

int knodesize(bt* node, int k);

bool ifsame(bt* node1, bt* node2);

bt* findbt(bt* node, int x);

void printlayer(bt* node);